#include "junix.h"
using namespace std;

int main(int argc, char **argv)
{
	std::string s="hello,world";
	s.replace(s.find(","),1,"*");
	cout<<s<<endl;

	cout<<s.find("*")<<endl;

	s="hello,world";
	s.replace(s.begin()+5,s.begin()+6,"I");
	cout<<s<<endl;


	s.replace(5,1,",");
	cout<<s<<endl;

	s.replace(5,1,9,'*');
	cout<<s<<endl;

	s.replace(5,9,1,',');
	cout<<s<<endl;

	string ss="junix";
	s.replace(s.begin()+s.find(",")+1,
			s.end(),ss);
	cout<<s<<endl;

	char buf[]="unix_jun";
	s.replace(s.begin()+s.find("junix"),
			s.end(),buf);
	cout<<s<<endl;

	s.replace(s.begin()+s.find("unix_jun"),
			s.end(),buf,4);
	cout<<s<<endl;

	s="hello,junix.This is C++";
	s.replace(s.begin()+s.find("junix"),
			s.begin()+s.find(".Th"),
			"Unix");
	cout<<s<<endl;
}
